<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.5"></script>
	
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
</style>
<script>
var contextPath='${contextPath}';
var _contextPath = '${staticServer}';

$(function(){
	$("#center_id").val("<#if pos??>${pos.center_id}</#if>");
	$("#state").val("<#if pos??>${pos.state}</#if>");
	$("#username").val("<#if pos??>${pos.username}</#if>");
	
});

var addNotice = function(){
	var id = $("#id").val();
	var title = $("#titles").val();
	var content = $("#content").val();
	var all_words = $("#all_words").val();
	var all_words4 = $("#all_words4").val();
	var oname = $("#oname").val();
	
	if(title==""){
		infopad.err("请填写标题!");
		return;
	}
	if(content==""){
		infopad.err("请填写内容!");
		return;
	}
	
	$.post("${contextPath}/index/addNotice_go.json", {
			"id":id,
			"title":title,
			"content":content,
			"all_words":all_words,
			"all_words4":all_words4,
			"oname":oname
		}, function(ms) {
		    var msg = ms.msg;
		    if(msg!=null && msg=="1"){
				infopad.msg("操作成功！");
				window.location.href="${contextPath}/index/notice_list.htm";
		    }else{
		    	infopad.err("操作失败，请联系管理员！");
		    }
			
	});
};

</script>
</head>
<input type="hidden" id="id" value="<#if notice??>${notice.id}</#if>">
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>

	<div id="container">
		<div id="title">添加Pos机</div>
		<table id="infotable">
			
			<tr>
				<th>标题:</th>
				<td><input id="titles" type="text" value="<#if notice??>${notice.title}</#if>" size="50" maxlength="30" /></td>
			</tr>
			
			<tr>
				<th>内容:</th>
				<td><textarea id="content" style="width: 364px;height:152px" type="text"/><#if notice??>${notice.content}</#if></textarea></td>
			</tr>
			
			<tr>
				<th>上传图片:</th>
				<td>
					<ul class="imglist">
					<div id="images" style="float: left;">
						<#if notice?? && notice.img_url?? && notice.img_url!="">
							<#list notice.img_url?split(",") as imgurl>
								<#if imgurl_index !=0>
								<li style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><img rel="800:485" width="180" height="109.125" src="http://www.yueqiao.org${imgurl}"></li>
								</#if>
							</#list>
						</#if>
					</div>
						
					<a class="file_box" style="list-style-type: none;float: left;display: block; width:180px; height:180px; overflow: hidden; border: 1px solid #EBEBEB; background: none repeat scroll 0 0 #F3F3F3; color: #999999; cursor: pointer; text-align: center; margin-left:10px; ">
                    <em style="background:url(${staticServer}/img/add_newpic.png) 0 0; display: inline-block; width:180px; height:180px; overflow: hidden;line-height: 20em; vertical-align: middle;">
                    <input type="file" id="upload" style="display: block;width:180px; height:180px;opacity: 0; filter:alpha(opacity=0); "></em>
                    </a>
                    <label class="zt_widthlabel" style=" font-size:9px; float:left; visibility:hidden;">文件：</label>
                    <input type="text" id="all_words" style=" width:100px; height:10px; float:left;visibility:hidden;" class="input w180" value="">
					</ul>
				</td>
			</tr>
			
			<tr>
				<th>上传文件:</th>
				<td>
					<ul class="imglist">
					<div id="images4" style="float: left;">
						<#if notice?? && notice.data_url?? && notice.data_url!="">
							<#list notice.data_url?split(",") as dataurl>
								<#if dataurl_index !=0>
								<li style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><a href="http://www.yueqiao.org${dataurl}">下载</a></li>
								</#if>
							</#list>
						</#if>
					</div>
						
					<a class="file_box" style="list-style-type: none;float: left;display: block; width:180px; height:180px; overflow: hidden; border: 1px solid #EBEBEB; background: none repeat scroll 0 0 #F3F3F3; color: #999999; cursor: pointer; text-align: center; margin-left:10px; ">
                    <em style="background:url(${staticServer}/img/add_newpic.png) 0 0; display: inline-block; width:180px; height:180px; overflow: hidden;line-height: 20em; vertical-align: middle;">
                    <input type="file" id="upload4" style="display: block;width:180px; height:180px;opacity: 0; filter:alpha(opacity=0); "></em>
                    </a>
                    <label class="zt_widthlabel" style=" font-size:9px; float:left; visibility:hidden;">文件：</label>
                    <input type="text" id="all_words4" style=" width:100px; height:10px; float:left;visibility:hidden;" class="input w180" value="">
					<input value="" type="hidden" id="oname" >
					</ul>
				</td>
			</tr>
			
		</table>
		<div id="controlbar">
			<input type="button" class="submit" onclick="addNotice()" value="  保  存  " />
		</div>
	</div>
	
</body>
</html>